import request from '@/utils/request'

export function forms(data) {
  return request({
    url: 'admin/cmd/v1/formconfig',
    method: 'post',
    data
  })
}

export function saveOrUpdate(data) {
  return request({
    url: 'admin/cmd/v1/formconfig',
    method: 'put',
    data
  })
}

export function get(id) {
  return request({
    url: 'admin/cmd/v1/formconfig/' + id,
    method: 'get'
  })
}

export function getFormCode(formCode, chooseLanguage) {
  return request({
    url: 'admin/cmd/v1/formconfig/' + formCode + '/' + chooseLanguage,
    method: 'get'
  })
}

export function getFeild(formCode, chooseLanguage) {
  return request({
    url: 'admin/cmd/v1/formconfig/feild/' + formCode + '/' + chooseLanguage,
    method: 'get'
  })
}

export function getFeildCondition(formCode, chooseLanguage) {
  return request({
    url: 'admin/cmd/v1/formconfig/condition/' + formCode + '/' + chooseLanguage,
    method: 'get'
  })
}

export function treeForm(id) {
  return request({
    url: 'admin/cmd/v1/formconfig/treeForm/' + id,
    method: 'get'
  })
}
